<?php
/**
 * import/test.phtml
 */
?>
<ul>
    <li><a href="#" id="hnp">Heures non planninfiés</a>Planning : <input type="text" id="planning" value="0">, Semaine : <input type="text" id="semaine" value="0"></li>
</ul>

<div id="ajax-content">
    <!-- AJAX CONTENT -->
</div>

<script type="text/javascript">
    $(function() {
	$('#hnp').click(function(e) {
	    e.preventDefault();
	    planning = parseInt($('#planning').val());
	    semaine = parseInt($('#semaine').val());
	    ajax = $.ajax({
		type: 'post',
		url: '<?php echo $this->url('RHX/default', array('controller'	 => 'import', 'action'	 => 'heureNonPlanifie')) ?>',
		data: '&id=' + planning + '&semaine=' + semaine
	    });
	    ajax.done(function(result) {
		$('#ajax-content').hide().html(result.heureNonPlanifie + '<br>').fadeIn('normal');
	    });
	    ajax.fail(function() {
		alert('Erreur');
	    });
	});
    });
</script>